agents.anac.y2010.AgentSmith
Class Bounds

java.lang.Object
  extended by agents.anac.y2010.AgentSmith.Bounds

public class Bounds
extends java.lang.Object

Class that is used to determine the bounds of an issue.


Constructor Summary
Bounds()
          Constructor
Bounds(Issue pIssue)
          Constructor.
 
Method Summary
 double getAmtSteps()
          returns the amount of steps
static java.util.HashMap<java.lang.Integer,Bounds> getIssueBounds(java.util.ArrayList<Issue> pIssues)
          Creates a hashmap with for each of the issues the bounds
static Value getIssueValue(Issue pIssue, double pIndex)
          returns a Value object with the value of an issue at the given index works for real, discrete and integer objects
 double getLower()
          returns the lower bound
static double getScaledIssueValue(Bounds pBounds, Bid pBid, Issue pIssue)
          returns the scaled value of the (discrete, real or integer) issue.
 double getStepSize()
          returns the number of steps
 double getUpper()
          returns the upper bound
 double normalize(double pValue)
          returns a normalized version of a value
 void setAmtSteps(double pAmtSteps)
          set the number of steps to take
 void setLower(double pLower)
          sets the lower bound
 void setUpper(double pUpper)
          sets the upper bound
 java.lang.String toString()
          returns a string with the upper and lower bounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bounds

public Bounds()
Constructor


Bounds

public Bounds(Issue pIssue)
Constructor. Sets the bounds for a given issue based on its type (discrete, real or integer)

Method Detail

getLower

public double getLower()
returns the lower bound


getUpper

public double getUpper()
returns the upper bound


getAmtSteps

public double getAmtSteps()
returns the amount of steps


getStepSize

public double getStepSize()
returns the number of steps


setLower

public void setLower(double pLower)
sets the lower bound


setUpper

public void setUpper(double pUpper)
sets the upper bound


setAmtSteps

public void setAmtSteps(double pAmtSteps)
set the number of steps to take


getIssueBounds

public static java.util.HashMap<java.lang.Integer,Bounds> getIssueBounds(java.util.ArrayList<Issue> pIssues)
Creates a hashmap with for each of the issues the bounds


getIssueValue

public static Value getIssueValue(Issue pIssue,
                                  double pIndex)
returns a Value object with the value of an issue at the given index works for real, discrete and integer objects


getScaledIssueValue

public static double getScaledIssueValue(Bounds pBounds,
                                         Bid pBid,
                                         Issue pIssue)
                                  throws java.lang.Exception
returns the scaled value of the (discrete, real or integer) issue. it is scaled by the difference between the value and the lower bound divided by the length of the bounds

Throws:
java.lang.Exception

normalize

public double normalize(double pValue)
returns a normalized version of a value


toString

public java.lang.String toString()
returns a string with the upper and lower bounds

Overrides:
toString in class java.lang.Object